<template>
    <div>
        <Modal v-model="modal.detail" title="详情" width="1020">
            <div class="detail-info">
                <Row>
	<i-col span="12"><span class="detail-title">SKU编号：</span><span v-text="form.id"></span></i-col>
<i-col span="12"><span class="detail-title">店铺编号：</span><span v-text="form.shopId"></span></i-col>


	<i-col span="12"><span class="detail-title">商品编号：</span><span v-text="form.goodsId"></span></i-col>
<i-col span="12"><span class="detail-title">商品图片编号：</span><span v-text="form.picId"></span></i-col>

	<i-col span="12"><span class="detail-title">售卖标题：</span><span v-text="form.title"></span></i-col>
<i-col span="12"><span class="detail-title">原价：</span><span v-text="form.price"></span></i-col>


	<i-col span="12"><span class="detail-title">销售价：</span><span v-text="form.salePrice"></span></i-col>
<i-col span="12"><span class="detail-title">库存：</span><span v-text="form.stockCount"></span></i-col>

	<i-col span="12"><span class="detail-title">上架状态：</span><span v-text="form.shelfStatus"></span></i-col>
<i-col span="12"><span class="detail-title">版本号：</span><span v-text="form.version"></span></i-col>


	<i-col span="12"><span class="detail-title">创建时间：</span><span v-text="form.createTime"></span></i-col>
<i-col span="12"><span class="detail-title">更新时间：</span><span v-text="form.updateTime"></span></i-col>


	<i-col span="12"><span class="detail-title">是否激活：</span><span v-text="form.isActive"></span></i-col>

<i-col span="12"><span class="detail-title">运费：</span><span v-text="expressFee"></span></i-col>
</Row>

            </div>
        </Modal>
    </div>
</template>

<script>
import * as utils from '@/api/utils-v2'
import * as ResponseStatus from '@/api/response-status'
    export default {
        name: 'GoodsSkuDetail',
        data() {
            return {
                modal: {
                    detail: false
                },
				dataDictCodes: ['IS_ACTIVE','GOODS_SHELF_STATUS'],
				dataDictItems: {},
                form: {
                    id: null,
shopId: null,
goodsId: null,
picId: null,
picUrl: null,
title: null,
price: null,
salePrice: null,
stockCount: null,
shelfStatus: null,
version: null,
createTime: null,
updateTime: null,
isActive: null,

                },
                expressFee: 0
            }
        },
        computed: {},
        mounted() {
        },
        methods: {
          /**
           * 加载商品运费
           */
          loadGoodsSkuExpressTemplate() {
            let params = {
              goodsId: this.form.goodsId,
              goodsSkuId: this.form.id
            }
            utils.doPostQs('/goods-express/any/get-express-template', params, {}).then(res => {
              if (res.data.code == ResponseStatus.OK) {
                this.expressFee = res.data.data.defaultFee
              } else {
                this.$Message.error(res.data.message)
              }
            }).catch(err => {
              this.$Message.error('获取运费信息异常')
            })
          },
		  getDictItemsDisplayValue() {
				utils.getDataDict(this.dataDictCodes).then(response => {
				if (response) {
					this.dataDictItems = response
					
					utils.getDetailDictItemDisplayValue(this, 'IS_ACTIVE', 'isActive')
					 utils.getDetailDictItemDisplayValue(this, 'GOODS_SHELF_STATUS', 'shelfStatus')
				}
				}).catch(error => {
				console.log(error)
				})
			}
        },
		
    }
</script>

<style>

</style>
